<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>PMS-business</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <link rel="stylesheet" type="text/css" href="css/homepage/style.css" />
	</head>
    <style>
        .col-one {
            height: 30vh;
            min-height: 280px;
            padding: 5px;
            padding-top: 10px;
        }

        .col-border{
            border:1px solid #62a8d1; 
            height:100%;
            border-radius:5px;
        }
        .col-one-header{
            height:100%;
            display: flex;
            flex-direction: row;
            align-items: center;
        }
        .col-one-header:before {   
            content: "";
            position: absolute;
            z-index: 999;
            left: 100%;
            bottom: 15%;
            width: 1px;
            height: 70%;
            background-color: #62a8d1
        }
        .col-one-img{
            width: 100%;
            float: left;
            height:40%; 
            padding: 10px;
        }
        .col-one-img img{ 
            width: 100% !important;  
            height: 100% !important;  
            max-width: 100% !important;  
            max-height: 100% !important;
            object-fit: contain !important;
        }
        .col-one-text{
            float: left;
            font-size: 14px;
            width: 100%;
        }
        .col-one-content{
            height:100%; 
            float:left; 
        }

        .banner-box{
            width: 100%;
            height: 100%;
            float: left;
            position: relative;
            overflow: hidden;
        }
        
    </style>
    <body>
        <div class="row">
            <div class="col-xs-12 col-one">
                <div class="col-xs-12 col-border no-padding">
                    <div class="col-xs-3 col-one-header">
                        <div class="col-one-img hide">      
                            <img src="">  
                        </div>
                        <div class="col-one-text">  
                            <div class="widget-box widget-color-blue" style="width: 80%;margin:0 auto;">
                                <div class="widget-header" style="text-align: center;padding: 0;">
                                    <h5 class="widget-title bigger lighter">华盛运维</h5>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main" style="padding:0 10px;">
                                        <ul class="list-unstyled spaced2 no-margin">
                                            <li style="margin: 5px 0px;">
                                                <i class="ace-icon fa fa-clock-o orange"></i>
                                                <span id="loginTime"></span>
                                            </li>
                                            <li style="margin: 5px 0px;">
                                                <i class="ace-icon fa fa-university green"></i>
                                                <span id="hotelname"></span>
                                            </li>

                                            <li style="margin: 5px 0px;">
                                                <i class="ace-icon fa fa-paper-plane orange"></i>
                                                <span id="IPAddress"></span>
                                            </li>

                                            <li style="margin: 5px 0px;">
                                                <i class="ace-icon fa fa-cubes green"></i>
                                                <span id="id-version"></span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                    <div class="col-xs-9 col-one-content">
                        <div class="banner-box">
                            <div class="swiper-container" style="margin: 0;">
                                <div class="swiper-wrapper"></div>
                                <div class="banner-arrow">
                                    <div class="swiper-button-prev"></div>
                                    <div class="swiper-button-next"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div id="homepage_search" class="col-sm-12" style="padding: 0px 5px;">
                
            </div>

            <div id="homepage_list"  class="col-sm-12" style="padding: 0px 5px;height: 418px;">
                
            </div>
            <div>
                <button id="test">测试</button>
            </div>

        </div>
        <script src="js/plugin/swiper.min.js"></script>
        <script src="js/plugin/jquery.echarts.js"></script>
        <script type="text/javascript"> 
            var ins_argjson={};
            $(".page-content-area").ace_ajax("loadScripts", new Array(), function() {
                $("#id-version").html(require("./package.json").version);
                $("#loginTime").text(localStorage.getItem("loginTime"));
                $("#hotelname").text(localStorage.getItem("hotelname"));

                const ip = require('ip');
                const IPAddress = ip.address();
                $("#IPAddress").text(IPAddress);
                
                // var doc = [{"bh":"001","mc":"西餐厅"},{"bh":"002","mc":"中餐厅"},{"bh":"003","mc":"温泉"},{"bh":"006","mc":"洗浴部"},{"bh":"007","mc":"华盛宫"}];
            
                // electron.ipcRenderer.sendSync('NEDB_REMOVE','test',{  }, { multi: true });
                // electron.ipcRenderer.sendSync('NEDB_INSERT','test',doc);
                // let a =  electron.ipcRenderer.sendSync('NEDB_FIND','test',{})
                // let b =  electron.ipcRenderer.sendSync('NEDB_COUNT','test',{})

                // var doc1 = {"key":"001","value":"西餐厅"}
                // electron.ipcRenderer.sendSync('NEDB_INSERT','localStorage',doc1);

                // electron.ipcRenderer.sendSync("NEDB_UPDATE","test",{ _id: 'id6' }, { $push: { fruits: 'banana' } },{})
                
                $.custom().then(({custom,C_DataSource,C_Where,C_Grid})=>{
                    var ScreenData = C_DataSource.ScreenBizData;

                    var param = {
                        searchBoxId:"#homepage_search",
                        gridBoxId:"#homepage_list",
                    }
                    custom.ScreenData = ScreenData;
                    custom.initJqgrid(param,function(){
                        
                    })
                })
                
                $("#test").unbind("click").click(function(){
                    // window.location.href = "#/html/test/test.html"
                    window.open("#/html/custom_build/custom_redirect.html","_self")
                    // require('child_process').exec('start D:\\fb\\FB.exe',function (err, stdout, stderr) { 
                    // call extraArgs with the "data" param and a callback as well 
                    // alert(123)
                    // })
                })

                //获取基础数据
                getBasicDs()


                function getBasicDs(){
                    //获取控制台基础数据
                    jQuery.ajax( {   
                        type : 'POST',
                        url :$.HSAPI_AJAXURL+"/qms/mobile/procedure2",  
                        data : $.HSAPI_ASKJSONINFO( JSON.stringify({"arg":{"kpitype":"控制台"}}),'InfoHouseKpi_ConPanel','{}'),     
                        dataType : 'json',  
                        success : function(data) {  
                            //logo
                            if(data.hasOwnProperty("logomain")&&data.logomain!=""){
                                $(".col-one-img").removeClass("hide");
                                $(".col-one-img").find("img").attr("src",data.logomain);
                                $(".col-one-header").css("flex-direction","column")
                            }else{
                                $(".col-one-header").css("flex-direction","row")
                            }
                            ins_argjson.data=data;
                                //概况
                                // oneContent(); 
                                //预离欠费预抵
                                // fourContent();
                                
                                if(data.hasOwnProperty("market"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="realTimeCustoms"></div>');
                                if(data.hasOwnProperty("rmtype"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="todayRentalRate"></div>');
                                if(data.hasOwnProperty("market7"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="guestAnalysis"></div>');
                                if(data.hasOwnProperty("sales7"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="sevenDayConsumption"></div>');
                                if(data.hasOwnProperty("manage7"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="sevenDayBusinessAnalysis"></div>');
                                if(data.hasOwnProperty("member7"))
                                    $(".swiper-wrapper").append('<div class="swiper-slide" name="sevenDayMembership"></div>');
                                var swiper = new Swiper('.swiper-container',{
                                    autoplay: 3000, //是否自动滚动
                                    speed: 500,      //滚动速速
                                    autoplayDisableOnInteraction: false,
                                    loop: true,
                                    centeredSlides: true,
                                    slidesPerView: 1, //当前选中
                                    pagination: '.swiper-pagination',
                                    paginationClickable: false,
                                    prevButton: '.swiper-button-prev', // 左右切换
                                    nextButton: '.swiper-button-next', // 左右切换
                                    onInit: function(swiper) {
                                        for(var i=0;i<document.getElementsByName("realTimeCustoms").length;i++){
                                            twoContentLeft(document.getElementsByName("realTimeCustoms")[i]);
                                        }
                                            
                                        for(var i=0;i<document.getElementsByName("todayRentalRate").length;i++){
                                            twoContentMiddle(document.getElementsByName("todayRentalRate")[i]);
                                        }
                                            
                                        for(var i=0;i<document.getElementsByName("guestAnalysis").length;i++){
                                            twoContentRight(document.getElementsByName("guestAnalysis")[i]);	
                                        }
                                            
                                        for(var i=0;i<document.getElementsByName("sevenDayConsumption").length;i++){
                                            threeContentLeft(document.getElementsByName("sevenDayConsumption")[i]);	
                                        }
                                            
                                        for(var i=0;i<document.getElementsByName("sevenDayBusinessAnalysis").length;i++){
                                            threeContentMiddle(document.getElementsByName("sevenDayBusinessAnalysis")[i]);	
                                        }
                                            
                                        for(var i=0;i<document.getElementsByName("sevenDayMembership").length;i++){
                                            threeContentRight(document.getElementsByName("sevenDayMembership")[i]);	
                                        }
                                            
                                    },
                                    breakpoints: {
                                        100: {
                                            slidesPerView: 0,
                                        }
                                    }
                                });

                        },  
                        error : function(data) {  
                                alert(JSON.stringify(data));
                                $("#pageOverlay").addClass("hide"); 
                                $("#loading").addClass("hide");
                        }  
                    });
                }

                function twoContentLeft(realTimeCustoms){
                    var data=ins_argjson.data;
                    var legendA=[];
                    var dataA=[];
                    var color=[];
                    var colorDe=["#6495ED","#9370DB","#8FBC8F","#93cbf9","#BA55D3","#3CB371","#FF4500","#B22222","#4682B4"];
                    var TOTAL=0;

                    if(data.hasOwnProperty("market")&&data.market.length>0){
                        $(data.market).each(function(k,v){
                            legendA.push($.i18n.propJsp(v.text));
                            dataA.push({"name":$.i18n.propJsp(v.text),"value":(v.hasOwnProperty("inhouse")?v.inhouse:0)});  
                            if(v.hasOwnProperty("color"))
                                color.push(v.color);
                            else
                                color.push(colorDe[k]);
                        });
                    }
                    
                    var myChart = echarts.init(realTimeCustoms); 
                    option = {
                            title: {
                                text:$.i18n.propJsp("实时客类分析"),
                                top:30,   
                                left: 10,
                                
                            },
                            tooltip: {
                                trigger: 'item',
                                formatter: '{a} <br/>{b}: {c} ({d}%)'
                            },
                            legend: {
                                orient: 'vertical',
                                top:80,
                                left: 10, 
                                data: legendA
                            },
                            series: [
                                { 
                                    name:$.i18n.propJsp("实时客类分析"),
                                    color:color, 
                                    type: 'pie',
                                    radius: ['50%', '70%'],
                                    avoidLabelOverlap: false,
                                    label: {
                                        normal: {
                                            show: false,
                                            position: 'center'
                                        },
                                        emphasis: {
                                            show: true,
                                            textStyle: {
                                                fontSize: '30',
                                                fontWeight: 'bold'
                                            }
                                        }
                                    },
                                    labelLine: {
                                        normal: {
                                            show: false
                                        }
                                    },
                                    data: dataA 
                                }
                            ]
                        };
                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                }

                function twoContentMiddle(todayRentalRate){
                    var myChart = echarts.init(todayRentalRate);  

                    var data=ins_argjson.data; 
                    var indicator=[];
                    var colorDe=["#6495ED","#9370DB"];
                    var inhouse=[];
                    var occupy=[];
                    
                    if(data.hasOwnProperty("rmtype")&&data.rmtype.length>0){
                        $(data.rmtype).each(function(k,v){
                            indicator.push({"name":$.i18n.propJsp(v.text),"max":100});
                            inhouse.push(v.hasOwnProperty("inhouse")?Number(v.inhouse/v.total*100).toFixed(2):0);     
                            occupy.push(Number(v.occupy/v.total*100).toFixed(2)); 
                        });
                    }
                    
                    option = {
                            title: {
                                text:$.i18n.propJsp("今日出租率分析"),
                                top:30,   
                                left: 10,
                            },
                            tooltip: {},
                            legend: {
                                orient: 'vertical', 
                                top:80,
                                left: 10, 
                                data: [$.i18n.propJsp("实时出租率"),$.i18n.propJsp("预出租率")]
                            },
                            radar: {
                                name: {
                                    textStyle: {
                                        color: '#fff',
                                        backgroundColor: '#999',
                                        borderRadius: 3,
                                        padding: [3, 5]
                                    }
                                },
                                indicator:indicator 
                            },
                            series: [{
                                type: 'radar',
                                color:colorDe,
                                areaStyle: {},
                                data: [
                                    {
                                        value: inhouse, 
                                        name:$.i18n.propJsp("实时出租率") 
                                    },
                                    {
                                        value: occupy, 
                                        name:$.i18n.propJsp("预出租率") 
                                    }
                                ]
                            }]
                        };

                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                }
                
                function twoContentRight(guestAnalysis){
                    var myChart = echarts.init(guestAnalysis);
                    
                    var data=ins_argjson.data; 
                    var colorDe=["#6495ED","#9370DB","#8FBC8F","#93cbf9","#BA55D3","#3CB371","#FF4500","#B22222","#4682B4"];   
                    var dataA=[];
                    var color=[];
                    
                    if(data.hasOwnProperty("market7")&&data.market7.length>0){
                        $(data.market7).each(function(k,v){
                            dataA.push({"name":$.i18n.propJsp(v.text),"value": v.hasOwnProperty("occupy")?v.occupy:0});  
                            if(v.hasOwnProperty("color"))
                                color.push(v.color);
                            else
                                color.push(colorDe[k]);
                        });
                    }
                    
                    option = {
                            title: {
                                text:$.i18n.propJsp("客类分析"),
                                subtext:$.i18n.propJsp("七天"),
                                top:30,   
                                left: 10,
                            },
                            tooltip: {
                                trigger: 'item',
                                formatter: '{a} <br/>{b} : {c} ({d}%)'
                            },
                            series: [
                                {
                                    name:$.i18n.propJsp("客类分析"),
                                    type: 'pie',
                                    label: {
                                        formatter: '{b}:{c}({d}%)'  
                                    },
                                    radius: '55%',
                                    color:color,  
                                    data:dataA ,
                                    emphasis: {
                                        itemStyle: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }
                            ]
                        };

                    
                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                    
                }
                
                function threeContentLeft(sevenDayConsumption){
                    var myChart = echarts.init(sevenDayConsumption);
                    
                    var data=ins_argjson.data;
                    var xAxisData=[];//日期
                    var seriesDataDebit=[];//收入
                    var seriesDataCredit=[];//支出
                    var seriesDataOccupancy=[];//出租率
                    
                    var max=0
                    if(data.hasOwnProperty("sales7")&&data.sales7.length>0){
                        $(data.sales7).each(function(k,v){
                            var debitNum=Number(v.debit);
                            var creditNum=Number(v.credit); 

                            if(debitNum>max)
                                max=debitNum; 
                            if(creditNum>max)
                                max=creditNum;
                            xAxisData.push(v.date);
                            seriesDataDebit.push(Number(v.debit).toFixed(2));
                            seriesDataCredit.push(Number(v.credit).toFixed(2));
                            seriesDataOccupancy.push(Number(v.occupancy*100).toFixed(2)); 
                        });
                    }
                    
                    max=(Number(max.toString().substring(0,1))+1)*Math.pow(10,Math.ceil(max).toString().length-1); 
                    
                    option = {
                            title: {
                                text: $.i18n.propJsp("七日消费数据"),
                                top:30,   
                                left: 10,
                            },
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {
                                    type: 'cross',
                                    crossStyle: {
                                        color: '#999'
                                    }
                                }
                            },
                            toolbox: {
                                feature: {
                                    dataView: {show: true, readOnly: false},
                                    magicType: {show: true, type: ['line', 'bar']},
                                    restore: {show: true},
                                    saveAsImage: {show: true}
                                }
                            },
                            legend: {
                                data: [$.i18n.propJsp("消费"), $.i18n.propJsp("收款")] 
                            },
                            grid: {
                                top: 85, 
                            },
                            xAxis: [
                                {
                                    type: 'category',
                                    data: xAxisData,
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                }
                            ],
                            yAxis: [
                                {
                                    type: 'value',
                                    name: $.i18n.propJsp("金额"),
                                    min: 0,
                                    max: max,
                                    interval:max/5,   
                                    axisLabel: {
                                        formatter: '{value} ¥'
                                    }
                                }
                            ],
                            series: [
                                {
                                    name: $.i18n.propJsp("收款"),
                                    type: 'bar',
                                    color:'#00FFFF',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataDebit
                                },
                                {
                                    name:$.i18n.propJsp("消费"),
                                    type: 'bar',
                                    color:'#FFA500',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataCredit 
                                }
                            ]
                        };

                    
                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                }
                
                function threeContentMiddle(sevenDayBusinessAnalysis){
                    var myChart = echarts.init(sevenDayBusinessAnalysis);

                    var data=ins_argjson.data;
                    var xAxisData=[];//日期
                    var seriesDataAverage=[];//平均房价
                    var seriesDataRepar=[];//repar
                    var seriesDataOccupancy=[];//出租率
                    
                    var max=0
                    if(data.hasOwnProperty("manage7")&&data.manage7.length>0){
                        $(data.manage7).each(function(k,v){
                            var averageNum=Number(v.average);
                            var reparNum=Number(v.repar); 

                            if(averageNum>max)
                                max=averageNum; 
                            if(reparNum>max)
                                max=reparNum;
                            xAxisData.push(v.date);
                            seriesDataAverage.push(v.hasOwnProperty("average")?Number(v.average).toFixed(2):0);
                            seriesDataRepar.push(v.hasOwnProperty("repar")?Number(v.repar).toFixed(2):0);
                            seriesDataOccupancy.push(v.hasOwnProperty("occupancy")?Number(v.occupancy*100).toFixed(2):0);   
                        });
                    }
                    
                    max=(Number(max.toString().substring(0,1))+1)*Math.pow(10,Math.ceil(max).toString().length-1); 
                    
                    
                    
                    option = {
                            title: {
                                text:$.i18n.propJsp("七日经营分析"),
                                top:30,   
                                left: 10,
                            },
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {
                                    type: 'cross',
                                    crossStyle: {
                                        color: '#999'
                                    }
                                } 
                            },
                            toolbox: {
                                feature: {
                                    dataView: {show: true, readOnly: false},
                                    magicType: {show: true, type: ['line', 'bar']},
                                    restore: {show: true},
                                    saveAsImage: {show: true}
                                }
                            },
                            legend: {
                                data: [$.i18n.propJsp("出租率"), 'REPAR', $.i18n.propJsp("平均房价")]
                            },
                            grid: {
                                top: 85, 
                            },
                            xAxis: [
                                {
                                    type: 'category',
                                    data: xAxisData,
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                }
                            ],
                            yAxis: [
                                {
                                    type: 'value',
                                    name: $.i18n.propJsp("金额"),
                                    min: 0,
                                    max: max,
                                    interval: max/5,   
                                    axisLabel: {
                                        formatter: '{value} ¥'
                                    }
                                },
                                {
                                    type: 'value',
                                    name:$.i18n.propJsp("出租率"),
                                    min: 0,
                                    max: 100,
                                    interval: 20, 
                                    axisLabel: {
                                        formatter: '{value} %'
                                    }
                                }
                            ],
                            series: [
                                {
                                    name:$.i18n.propJsp("平均房价"),
                                    type: 'bar',
                                    color:'#87CEFA',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataAverage
                                },
                                {
                                    name: 'REPAR',
                                    type: 'bar',
                                    color:'#8B0000',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataRepar
                                },
                                {
                                    name:$.i18n.propJsp("出租率"), 
                                    type: 'line',
                                    yAxisIndex: 1,
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataOccupancy
                                }
                            ]
                        };

                    
                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                }

                function threeContentRight(sevenDayMembership){
                    var myChart = echarts.init(sevenDayMembership);
                    
                    
                    var data=ins_argjson.data;
                    var xAxisData=[];//日期
                    var seriesDataDebit=[];//收入
                    var seriesDataCredit=[];//支出
                    var seriesDataAdd=[];//会员增加人数
                    
                    var max=0;
                    var maxMember=0;
                    if(data.hasOwnProperty("member7")&&data.member7.length>0){
                        $(data.member7).each(function(k,v){
                            var debitNum=Number(Number(v.debit).toFixed(2));
                            var creditNum=Number(Number(v.credit).toFixed(2)); 
                            var addNum=Number(Number(v.add).toFixed(0));  

                            if(debitNum>max)
                                max=debitNum; 
                            if(creditNum>max)
                                max=creditNum;
                            if(addNum>maxMember)
                                maxMember=addNum;
                                
                            xAxisData.push(v.date);
                            seriesDataDebit.push(v.hasOwnProperty("debit")?v.debit:0);
                            seriesDataCredit.push(v.hasOwnProperty("credit")?v.credit:0);
                            seriesDataAdd.push(v.hasOwnProperty("seriesDataAdd")?v.seriesDataAdd:0); 
                        });
                    }
                    max=(Number(max.toString().substring(0,1))+1)*Math.pow(10,Math.ceil(max).toString().length-1); 
                    maxMember=(Number(maxMember.toString().substring(0,1))+1)*Math.pow(10,Math.ceil(maxMember).toString().length-1); 
                    
                    
                    option = {
                            title: {
                                text:$.i18n.propJsp("七日会员数据"),
                                top:30,   
                                left: 10,
                            },
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {
                                    type: 'cross',
                                    crossStyle: {
                                        color: '#999'
                                    }
                                }
                            },
                            toolbox: {
                                feature: {
                                    dataView: {show: true, readOnly: false},
                                    magicType: {show: true, type: ['line', 'bar']},
                                    restore: {show: true},
                                    saveAsImage: {show: true}
                                }
                            },
                            legend: {
                                data: [$.i18n.propJsp("新增会员"), $.i18n.propJsp("会员充值"),$.i18n.propJsp("会员消费")] 
                            },
                            grid: {
                                top: 85, 
                            },
                            xAxis: [
                                {
                                    type: 'category',
                                    data: xAxisData,
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                }
                            ],
                            yAxis: [
                                {
                                    type: 'value',
                                    name: $.i18n.propJsp("金额"),
                                    min: 0,
                                    max: max,
                                    interval: max/5,   
                                    axisLabel: {
                                        formatter: '{value} ¥'
                                    }
                                },
                                {
                                    type: 'value',
                                    name: $.i18n.propJsp("新增会员"),
                                    min: 0,
                                    max: maxMember,  
                                    interval:Math.ceil(maxMember/5),     
                                    axisLabel: {
                                        formatter: '{value} '+$.i18n.propJsp("人")
                                    }
                                }
                            ],
                            series: [
                                {
                                    name:$.i18n.propJsp("会员消费"),
                                    type: 'bar',
                                    color:'#FFA500',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data: seriesDataDebit
                                },
                                {
                                    name:$.i18n.propJsp("会员充值"),
                                    type: 'bar',
                                    color:'#87CEFA',
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data: seriesDataCredit
                                },
                                {
                                    name:$.i18n.propJsp("新增会员"),
                                    type: 'line',
                                    yAxisIndex: 1,
                                    label: {
                                        show: true,
                                        position: 'top'
                                    },
                                    data:seriesDataAdd 
                                }
                            ]
                        };

                    
                    myChart.setOption(option);
                    window.addEventListener("resize",function(){
                        myChart.resize();
                    });
                }

                function oneContent(){
                    var data=ins_argjson.data;
                    var param={};
                    var TOTAL=0;
                    if(data.hasOwnProperty("roomssummary")){
                        $(data["roomssummary"]).each(function(k,v){
                            if(v.name=="TOTAL")
                                TOTAL=Number(v.rooms);
                        });
                    }
                    if(data.hasOwnProperty("statistics")&&data.statistics.length>0){
                        var colors=["#93cbf9","#BA55D3","#3CB371","#FF4500","#B22222","#4682B4"]
                        $(data.statistics).each(function(k,v){
                            param[v.name]={
                                    "persent":v.hasOwnProperty("rooms")?v.rooms:0, 
                                    "text":$.i18n.propJsp(v.text),
                                    "color":(v.hasOwnProperty("color")?v.color:colors[k])
                                }
                        });
                    }
                    for(var item in param){
                        var myChart = echarts.init(document.getElementById(item)); 
                        var v1=Number(param[item].persent).toFixed(2)
                        var v2=Number(TOTAL-Number(param[item].persent)).toFixed(2) 
                        option = {	
                            series: [{
                                type: 'pie',
                                radius: ['60%', '70%'],
                                color:param[item].color, 
                                label: {
                                    normal: {
                                        position: 'center'
                                    }
                                },
                                data: 	[{
                                            value: v1,
                                            label: {
                                                normal: {
                                                    formatter:Number(v1).toFixed(0) +"\n"+$.i18n.propJsp(param[item].text),            
                                                    show : true,
                                                    textStyle: {
                                                        fontSize: 15, 
                                                        color:param[item].color,   
                                                    }
                                                }
                                            }
                                        },{ 
                                            value: v2,
                                            label: {
                                                normal: {
                                                    show : false, 
                                                }
                                            },
                                            itemStyle: {
                                                normal: {
                                                    color: '#C0C0C0'  
                                                },
                                                emphasis: {
                                                    color: 'red'  
                                                }
                                            },
                                        }]
                            }]
                        };
                        myChart.setOption(option);
                        window.addEventListener("resize",function(){
                            myChart.resize();
                        }); 
                    }
                }

                function fourContent(){
                    //预订未抵
                    var mydate = new Date();
                    var Month=mydate.getMonth()+1<10?"0"+(mydate.getMonth()+1):mydate.getMonth()+1;  
                    var day=mydate.getDate()<10?"0"+mydate.getDate():mydate.getDate();   
                        
                    var where={}; 
                    var fileds={}; 
                    var table={};  
                    var nowDate=mydate.getFullYear()+""+Month+""+day;
                    where.where={"Status":"0","arr_d":nowDate};
                    fileds.fileds=["gno","gname","arr_d","exp_dep_d","str4"];
                    table.table={"table":"viewJqGrid_ho_guest_listAll"};
                    wherestring={};
                    wherestring.wherestring=["##rmtype","@@NE","PM","@@AD","##rmtype","@@NE","PF","@@AD","##rmtype","@@NE","PX"];
                    var noshowc = askJsonInfo(JSON.stringify(jQuery.extend({},where,fileds,table,wherestring)),'RetrieveJqGridList',"list");
                    $("#arrival").hsTable({	 					
                        parameter:{"area": "预抵","fileds": ["gno","gname","arr_d","exp_dep_d","str4"]},			 		
                        tableId:'noshow',					
                        getDatePra:noshowc,
                        getDateUrl: $.HSAPI_AJAXURL+$.HSAPI_PROCEDUREGRID,
                        filter:"", 
                    });
                    
                    
                    //预离
                    where.where={"1":"1"};
                    fileds.fileds=["gno","gname","room","arr_d","exp_dep_d","balance"];
                    table.table={"table":"viewJqGrid_ho_guest_listAll"};
                    wherestring.wherestring=["##status","@@GTE","1","@@AD","##status","@@LTE","4","@@AD","##exp_dep_d","@@EQ",nowDate,
                        "@@AD","##rmtype","@@NE","PM",
                        "@@AD","##rmtype","@@NE","PF",
                        "@@AD","##rmtype","@@NE","PX"];
                    var dueout = askJsonInfo(JSON.stringify(jQuery.extend({},where,fileds,table,wherestring)),'RetrieveJqGridList',"list");
                    $("#dueOut").hsTable({						
                        parameter:{"area": "预离","fileds": ["gno","gname","room","arr_d","exp_dep_d","balance"]},					
                        tableId:'dueout',					
                        getDatePra:dueout,
                        getDateUrl: $.HSAPI_AJAXURL+$.HSAPI_PROCEDUREGRID,
                        filter:"",
                    });
                    
                    
                    //欠费
                    where.where={"1":"1"}; 
                    fileds.fileds=["gno","gname","room","arr_d","exp_dep_d","balance"];
                    table.table={"table":"viewJqGrid_ho_guest_listAll"};
                    wherestring.wherestring=["##status","@@GTE","1","@@AD","##status","@@LTE","4","@@AD","##balance","@@LT","0",
                        "@@AD","##rmtype","@@NE","PM",
                        "@@AD","##rmtype","@@NE","PF",
                        "@@AD","##rmtype","@@NE","PX"];
                    var arrearage = askJsonInfo(JSON.stringify(jQuery.extend({},where,fileds,table,wherestring)),'RetrieveJqGridList',"list");
                    $("#owe").hsTable({	  					
                        parameter:{"area": "欠费","fileds": ["gno","gname","room","arr_d","exp_dep_d","balance"]},					
                        tableId:'arrearage',					
                        getDatePra:arrearage,
                        getDateUrl: $.HSAPI_AJAXURL+$.HSAPI_PROCEDUREGRID,
                        filter:"",
                    });
                    
                }

            });
        </script>
	</body>
</html>